/**
 * 
 */
package com.web.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.base.web.interceptor.BaseLoginInterceptor;
import com.model.User;
import com.util.UserLoginUtil;

/**
 * @author leiruiqi
 *
 */
public class LoginInterceptor extends BaseLoginInterceptor {

	@Override
	public boolean checkLogin(HttpServletRequest req, HttpServletResponse res) {
		String value = UserLoginUtil.getCookieValue(req, res, "a_b_c_d");
		if(value==null){
			return false;
		}
		User user = new User();
		user.setUserName(value);
		UserLoginUtil.setCurrentUser(user);
		return true;
	}
}
